﻿@using Library
@model List<Ecommerce.Models.ProductViewModel.SpecificationGroupView>

<h4>@NOWCulture.GetString("Specifications")</h4>
@foreach (var specGroupView in Model)
{
    var specGroup = specGroupView.SpecificationGroup;
    var specificationGroupCulture = specGroup.SpecificationGroupCultures.SingleOrDefault(i => i.Culture == NOWCulture.CurrentCulture) ?? specGroup.SpecificationGroupCultures.First();
    <h5 class="specification-group">@specificationGroupCulture.Name</h5>

    <table class="table table-striped table-bordered specifications">
        <tbody>
            @foreach (var spec in specGroupView.Specifications)
            {
                var specCulture = spec.Key.SpecificationCultures.SingleOrDefault(i => i.Culture == NOWCulture.CurrentCulture) ?? spec.Key.SpecificationCultures.First();
                <tr>
                    <th scope="row">@specCulture.Name</th>
                    <td>@spec.Value.Value</td>
                </tr>
            }
        </tbody>
    </table>
}
